package com.workshop.dao;

import com.workshop.entity.ACategory;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.baomidou.mybatisplus.mapper.BaseMapper;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author chengluqiang
 * @since 2019-04-13
 */
public interface ACategoryDao extends BaseMapper<ACategory> {

	 @Select("SELECT acy.id categoryId,acy.`name` categoryName FROM `a_category` acy " +
	            " ORDER BY acy.create_time DESC"+
	            " LIMIT #{pageStart},#{pageTotal}")
	 List<Map<String,Object>> getCategoryList(@Param("pageStart") long sqlStart,@Param("pageTotal")long pageTotal);
	 @Select("SELECT  " +
	            "  COUNT(acy.id)  " +
	            "FROM  " +
	            "  a_category acy  ")
	long getCategoryCount();

}
